package com.rem.controller;

import com.example.teststarterautoconfigure.service.HelloService;
import com.rem.annotation.MyAnnotation;
import com.rem.pojo.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @author remembrance
 * @version 1.0
 * @date 2021/11/5 13:45
 */

@Controller
@MyAnnotation(name = "aaa")
public class TestController {

    @Autowired
    HelloService helloService;

    @Autowired
    Test test;

    @ResponseBody
    @RequestMapping("/hello")
    public String hello(){
        return "hello world! 你好";
    }

    @ResponseBody
    @RequestMapping("/test")
    public Test test(){
        return test;
    }

    @ResponseBody
    @GetMapping("/mystarter")
    public String mystarter(@RequestParam("name") String name){
        return helloService.sayHello(name);
    }

}